<template>
  <div class="bg">
    <!-- 头部 -->
    <Header title="运维管理—设备台账"></Header>

    <!-- 搜索栏 -->
    <section class="search_bar">
      <LInput label="设备名称" v-model="name"></LInput>
      <LSelect label="院区" :value="campus" :options="option1" @selected-event="getNewSelected1" style="margin-left: 16px"></LSelect>
      <LSelect label="设备系统" :value="esys" :options="option2" @selected-event="getNewSelected2" style="margin-left: 16px"></LSelect>
      <LInput label="规格型号" v-model="spec" style="margin-left: 16px"></LInput>
      <LInput label="安装位置" v-model="position" style="margin-left: 16px"></LInput>
      <LButton label="更多" style="margin-left: 16px" @click="close = true"></LButton>
    </section>
    <section class="search_bar" v-show="close">
      <LSelect label="设备状态" :value="state" :options="option3" @selected-event="getNewSelected3"></LSelect>
      <LInput label="设备编码" v-model="no" style="margin-left: 16px"></LInput>
      <LSelect label="楼宇" :value="louyu" :options="option4" @selected-event="getNewSelected4" style="margin-left: 16px"></LSelect>
      <LSelect label="设备分类" :value="cate" :options="option5" @selected-event="getNewSelected5" style="margin-left: 16px"></LSelect>
      <LSelect label="管理人" :value="guanli" :options="option6" @selected-event="getNewSelected6" style="margin-left: 16px"></LSelect>
      <LSelect label="运维单位" :value="yunwei" :options="option7" @selected-event="getNewSelected7" style="margin-left: 16px"></LSelect>
    </section>
    <section class="search_bar" v-show="close">
      <LDateTimeSelect2 label="安装时间" :value="time" @time-event="getNewTime"></LDateTimeSelect2>
      <LSelect label="所属单位" :value="suoshu" :options="option8" @selected-event="getNewSelected8" style="margin-left: 16px"></LSelect>
      <LInput label="设备部门" v-model="dep" :options="option9" @selected-event="getNewSelected9" style="margin-left: 16px"></LInput>
      <LInput2 label="设备原值(元）:" :value="v1" :value2="v2" @input-event="getNewInput1" @input-event2="getNewInput2" style="margin-left: 16px"></LInput2>
      <LInput label="品牌" v-model="brand" style="margin-left: 16px"></LInput>

    </section>
    <section class="search_bar" v-show="close">
      <LInput label="生产商" v-model="supplier"></LInput>
      <LButton label="收起条件" style="margin-left: 16px" @click="close = false"></LButton>
    </section>
    <section class="search_bar">
      <LButton label="＋新增设备" style="margin-left: 16px" @click="repairDialog = true"></LButton>
      <LButton label="查询数据" style="margin-left: 16px"></LButton>
      <LButton label="重置条件" style="margin-left: 16px" @click="clearSelected"></LButton>
      <LButton label="导出数据" style="margin-left: 16px" @click="exportExcel"></LButton>
    </section>
    <!-- 表格 -->
    <el-table :data="tableData1" style="width: 100%" border>
      <el-table-column prop="a" label="设备名称" />
      <el-table-column prop="b" label="设备编码" width="80" />
      <el-table-column prop="c" label="规格型号" />
      <el-table-column prop="d" label="院区" />
      <el-table-column prop="e" label="所属楼宇" />
      <el-table-column prop="f" label="设备系统" />
      <el-table-column prop="g" label="设备类别" />
      <el-table-column prop="h" label="设备状态" width="80" />
      <el-table-column prop="i" label="安装时间" />
      <el-table-column prop="j" label="安装位置" />
      <el-table-column prop="k" label="设备原值(元)" />
      <el-table-column prop="l" label="品牌" />
      <el-table-column prop="m" label="生产商" />
      <el-table-column prop="n" label="保修年限" />
      <el-table-column prop="o" label="出厂编码" />
      <el-table-column label="操作" width="300">
        <template #default>
          <el-button type="success" size="mini" @click="repairDialog1 = true">查看</el-button>
          <el-button type="info" size="mini" @click="goto">查看履历</el-button>
          <el-button type="primary" size="mini" @click="repairDialog2 = true">编辑</el-button>
          <el-button type="danger" size="mini" @click="del">删除</el-button>
        </template>
      </el-table-column>
    </el-table>

    <!-- 弹出框：新增 -->
    <div v-dialogdrag>
      <el-dialog v-model="repairDialog" title="新增" width="40%" @close="repairDialogClose">
        <div class="dialog-border">
          <el-form label-width="120px" :model="repairForm" ref="repairFormRef" :rules="repairFormRules" size="mini">
            <div class="row-1">
              <el-form-item label="设备编码" prop="a" style="width:100%">
                <el-input v-model="repairForm.a"></el-input>
              </el-form-item>
              <el-form-item label="设备名称" prop="b" style="width:100%">
                <el-input v-model="repairForm.b"></el-input>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="序列号" prop="c" style="width:100%">
                <el-input v-model="repairForm.c"></el-input>
              </el-form-item>
              <el-form-item label="出厂编号" prop="d" style="width:100%">
                <el-input v-model="repairForm.d"></el-input>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="区域" prop="e" style="width:100%">
                <el-select v-model="repairForm.e" filterable>
                  <el-option label="梁山县1" value="1"></el-option>
                  <el-option label="梁山县2" value="2"></el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="部门" prop="f" style="width:100%">
                <el-select v-model="repairForm.f" filterable>
                  <el-option label="主楼" value="1"></el-option>
                  <el-option label="辅楼" value="2"></el-option>
                </el-select>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="设备系统" prop="g" style="width:100%">
                <el-select v-model="repairForm.g" filterable>
                  <el-option label="公共设备1" value="1"></el-option>
                  <el-option label="公共设备2" value="2"></el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="设备类别" prop="h" style="width:100%">
                <el-select v-model="repairForm.h" filterable>
                  <el-option label="冷水机组1" value="1"></el-option>
                  <el-option label="冷水机组2" value="2"></el-option>
                </el-select>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="产地" prop="i" style="width:100%">
                <el-input v-model="repairForm.i"></el-input>
              </el-form-item>
              <el-form-item label="状态" prop="j" style="width:100%">
                <el-select v-model="repairForm.j" filterable>
                  <el-option label="正常" value="1"></el-option>
                  <el-option label="维修" value="2"></el-option>
                </el-select>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="安装位置" prop="k" style="width:100%">
                <el-input v-model="repairForm.k"></el-input>
              </el-form-item>
              <el-form-item label="品牌" prop="l" style="width:100%">
                <el-input v-model="repairForm.l"></el-input>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="规格型号" prop="m" style="width:100%">
                <el-input v-model="repairForm.m"></el-input>
              </el-form-item>
              <el-form-item label="供应商" prop="n" style="width:100%">
                <el-input v-model="repairForm.n"></el-input>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="生产商" prop="o" style="width:100%">
                <el-input v-model="repairForm.o"></el-input>
              </el-form-item>
              <el-form-item label="使用年限(年)" prop="p" style="width:100%">
                <el-input v-model="repairForm.p" placeholder="数字"></el-input>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="保修期(年)" prop="q" style="width:100%">
                <el-input v-model="repairForm.q" placeholder="数字"></el-input>
              </el-form-item>
              <el-form-item label="购置日期" prop="r" style="width:100%">
                <el-date-picker v-model="repairForm.r" type="date" placeholder="格式：YYYY-MM-DD"></el-date-picker>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="安装日期" prop="s" style="width:100%">
                <el-date-picker v-model="repairForm.s" type="date" placeholder="格式：YYYY-MM-DD"></el-date-picker>
              </el-form-item>
              <el-form-item label="设备原值(元)" prop="t" style="width:100%">
                <el-input v-model="repairForm.t" placeholder="数字"></el-input>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="是否固资" prop="u" style="width:100%">
                <div class="row-1-border">
                  <el-radio v-model="repairForm.b" label="1" size="mini">是</el-radio>
                  <el-radio v-model="repairForm.b" label="2" size="mini">否</el-radio>
                </div>
              </el-form-item>
              <el-form-item label="IP地址" prop="v" style="width:100%">
                <el-input v-model="repairForm.v"></el-input>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="购资价(元)" prop="w" style="width:100%">
                <el-input v-model="repairForm.w" placeholder="数字"></el-input>
              </el-form-item>
              <el-form-item label="分摊价(元)" prop="x" style="width:100%">
                <el-input v-model="repairForm.x" placeholder="数字"></el-input>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="折旧率(%)" prop="y" style="width:100%">
                <el-input v-model="repairForm.y" placeholder="数字"></el-input>
              </el-form-item>
              <el-form-item label="主维保方" prop="z" style="width:100%">
                <el-input v-model="repairForm.z"></el-input>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="维保执行方" prop="aa" style="width:100%">
                <el-input v-model="repairForm.aa"></el-input>
              </el-form-item>
              <el-form-item label="维保执行方地址" prop="ab" style="width:100%">
                <el-input v-model="repairForm.ab"></el-input>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="维保执行方姓名" prop="ac" style="width:100%">
                <el-input v-model="repairForm.ac"></el-input>
              </el-form-item>
              <el-form-item label="维保执行方电话" prop="ad" style="width:100%">
                <el-input v-model="repairForm.ad"></el-input>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="维保起始日期" prop="ae" style="width:100%">
                <el-date-picker v-model="repairForm.ae" type="date" placeholder="格式：YYYY-MM-DD"></el-date-picker>
              </el-form-item>
              <el-form-item label="维保起始结束" prop="af" style="width:100%">
                <el-date-picker v-model="repairForm.af" type="date" placeholder="格式：YYYY-MM-DD"></el-date-picker>
              </el-form-item>
            </div>
            <div style="padding: 0 2vw 0 0">
              <el-form-item label="描述" prop="ag" style="width:100%">
                <el-input v-model="repairForm.ag" type="textarea" :rows="1"></el-input>
              </el-form-item>
              <el-form-item label="文件资料" prop="ah" style="width:100%">
                <el-upload class="upload-demo" action="https://jsonplaceholder.typicode.com/posts/" :on-preview="handlePreview" :on-remove="handleRemove" :before-remove="beforeRemove" multiple :limit="6" :on-exceed="handleExceed" :file-list="fileList">
                  <el-button size="small" type="primary">点击上传</el-button>
                  <span style="font-size:8px"> (最多上传6个文件)</span>
                </el-upload>
              </el-form-item>
            </div>
          </el-form>
        </div>
        <template #footer>
          <span class="dialog-footer">
            <el-button type="primary" size="mini" @click="repairSureBtn">确定</el-button>
            <el-button type="info" size="mini" @click="repairDialog = false">取消</el-button>
          </span>
        </template>
      </el-dialog>
    </div>

    <!-- 弹出框：查看 -->
    <div v-dialogdrag>
      <el-dialog v-model="repairDialog1" title="查看" width="40%" @close="repairDialog1Close">
        <div class="dialog-border">
          <el-form label-width="120px" :model="repairForm1" ref="repairForm1Ref" :rules="repairForm1Rules" size="mini">
            <div class="row-1">
              <el-form-item label="设备编码" prop="a" style="width:100%">
                <el-input v-model="repairForm.a"></el-input>
              </el-form-item>
              <el-form-item label="设备名称" prop="b" style="width:100%">
                <el-input v-model="repairForm.b"></el-input>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="序列号" prop="c" style="width:100%">
                <el-input v-model="repairForm.c"></el-input>
              </el-form-item>
              <el-form-item label="出厂编号" prop="d" style="width:100%">
                <el-input v-model="repairForm.d"></el-input>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="区域" prop="e" style="width:100%">
                <el-select v-model="repairForm.e" filterable>
                  <el-option label="梁山县1" value="1"></el-option>
                  <el-option label="梁山县2" value="2"></el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="部门" prop="f" style="width:100%">
                <el-select v-model="repairForm.f" filterable>
                  <el-option label="主楼" value="1"></el-option>
                  <el-option label="辅楼" value="2"></el-option>
                </el-select>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="设备系统" prop="g" style="width:100%">
                <el-select v-model="repairForm.g" filterable>
                  <el-option label="公共设备1" value="1"></el-option>
                  <el-option label="公共设备2" value="2"></el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="设备类别" prop="h" style="width:100%">
                <el-select v-model="repairForm.h" filterable>
                  <el-option label="冷水机组1" value="1"></el-option>
                  <el-option label="冷水机组2" value="2"></el-option>
                </el-select>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="产地" prop="i" style="width:100%">
                <el-input v-model="repairForm.i"></el-input>
              </el-form-item>
              <el-form-item label="状态" prop="j" style="width:100%">
                <el-select v-model="repairForm.j" filterable>
                  <el-option label="正常" value="1"></el-option>
                  <el-option label="维修" value="2"></el-option>
                </el-select>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="安装位置" prop="k" style="width:100%">
                <el-input v-model="repairForm.k"></el-input>
              </el-form-item>
              <el-form-item label="品牌" prop="l" style="width:100%">
                <el-input v-model="repairForm.l"></el-input>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="规格型号" prop="m" style="width:100%">
                <el-input v-model="repairForm.m"></el-input>
              </el-form-item>
              <el-form-item label="供应商" prop="n" style="width:100%">
                <el-input v-model="repairForm.n"></el-input>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="生产商" prop="o" style="width:100%">
                <el-input v-model="repairForm.o"></el-input>
              </el-form-item>
              <el-form-item label="使用年限(年)" prop="p" style="width:100%">
                <el-input v-model="repairForm.p" placeholder="数字"></el-input>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="保修期(年)" prop="q" style="width:100%">
                <el-input v-model="repairForm.q" placeholder="数字"></el-input>
              </el-form-item>
              <el-form-item label="购置日期" prop="r" style="width:100%">
                <el-date-picker v-model="repairForm.r" type="date" placeholder="格式：YYYY-MM-DD"></el-date-picker>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="安装日期" prop="s" style="width:100%">
                <el-date-picker v-model="repairForm.s" type="date" placeholder="格式：YYYY-MM-DD"></el-date-picker>
              </el-form-item>
              <el-form-item label="设备原值(元)" prop="t" style="width:100%">
                <el-input v-model="repairForm.t" placeholder="数字"></el-input>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="是否固资" prop="u" style="width:100%">
                <div class="row-1-border">
                  <el-radio v-model="repairForm.b" label="1" size="mini">是</el-radio>
                  <el-radio v-model="repairForm.b" label="2" size="mini">否</el-radio>
                </div>
              </el-form-item>
              <el-form-item label="IP地址" prop="v" style="width:100%">
                <el-input v-model="repairForm.v"></el-input>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="购资价(元)" prop="w" style="width:100%">
                <el-input v-model="repairForm.w" placeholder="数字"></el-input>
              </el-form-item>
              <el-form-item label="分摊价(元)" prop="x" style="width:100%">
                <el-input v-model="repairForm.x" placeholder="数字"></el-input>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="折旧率(%)" prop="y" style="width:100%">
                <el-input v-model="repairForm.y" placeholder="数字"></el-input>
              </el-form-item>
              <el-form-item label="主维保方" prop="z" style="width:100%">
                <el-input v-model="repairForm.z"></el-input>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="维保执行方" prop="aa" style="width:100%">
                <el-input v-model="repairForm.aa"></el-input>
              </el-form-item>
              <el-form-item label="维保执行方地址" prop="ab" style="width:100%">
                <el-input v-model="repairForm.ab"></el-input>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="维保执行方姓名" prop="ac" style="width:100%">
                <el-input v-model="repairForm.ac"></el-input>
              </el-form-item>
              <el-form-item label="维保执行方电话" prop="ad" style="width:100%">
                <el-input v-model="repairForm.ad"></el-input>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="维保起始日期" prop="ae" style="width:100%">
                <el-date-picker v-model="repairForm.ae" type="date" placeholder="格式：YYYY-MM-DD"></el-date-picker>
              </el-form-item>
              <el-form-item label="维保起始结束" prop="af" style="width:100%">
                <el-date-picker v-model="repairForm.af" type="date" placeholder="格式：YYYY-MM-DD"></el-date-picker>
              </el-form-item>
            </div>
            <div style="padding: 0 2vw 0 0">
              <el-form-item label="描述" prop="ag" style="width:100%">
                <el-input v-model="repairForm.ag" type="textarea" :rows="1"></el-input>
              </el-form-item>
              <el-form-item label="文件资料" prop="ah" style="width:100%">
                <el-upload class="upload-demo" action="https://jsonplaceholder.typicode.com/posts/" :on-preview="handlePreview" :on-remove="handleRemove" :before-remove="beforeRemove" multiple :limit="6" :on-exceed="handleExceed" :file-list="fileList">
                  <el-button size="small" type="primary">点击上传</el-button>
                  <span style="font-size:8px"> (最多上传6个文件)</span>
                </el-upload>
              </el-form-item>
              <el-form-item label="设备二维码"></el-form-item>
            </div>
          </el-form>
        </div>
        <template #footer>
          <span class="dialog-footer">
            <el-button type="info" size="mini" @click="repairDialog1 = false">关闭</el-button>
          </span>
        </template>
      </el-dialog>
    </div>

    <!-- 弹出框：编辑 -->
    <div v-dialogdrag>
      <el-dialog v-model="repairDialog2" title="编辑" width="40%" @close="repairDialog2Close">
        <div class="dialog-border">
          <el-form label-width="120px" :model="repairForm2" ref="repairForm2Ref" :rules="repairForm2Rules" size="mini">
            <div class="row-1">
              <el-form-item label="设备编码" prop="a" style="width:100%">
                <el-input v-model="repairForm.a"></el-input>
              </el-form-item>
              <el-form-item label="设备名称" prop="b" style="width:100%">
                <el-input v-model="repairForm.b"></el-input>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="序列号" prop="c" style="width:100%">
                <el-input v-model="repairForm.c"></el-input>
              </el-form-item>
              <el-form-item label="出厂编号" prop="d" style="width:100%">
                <el-input v-model="repairForm.d"></el-input>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="区域" prop="e" style="width:100%">
                <el-select v-model="repairForm.e" filterable>
                  <el-option label="梁山县1" value="1"></el-option>
                  <el-option label="梁山县2" value="2"></el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="部门" prop="f" style="width:100%">
                <el-select v-model="repairForm.f" filterable>
                  <el-option label="主楼" value="1"></el-option>
                  <el-option label="辅楼" value="2"></el-option>
                </el-select>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="设备系统" prop="g" style="width:100%">
                <el-select v-model="repairForm.g" filterable>
                  <el-option label="公共设备1" value="1"></el-option>
                  <el-option label="公共设备2" value="2"></el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="设备类别" prop="h" style="width:100%">
                <el-select v-model="repairForm.h" filterable>
                  <el-option label="冷水机组1" value="1"></el-option>
                  <el-option label="冷水机组2" value="2"></el-option>
                </el-select>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="产地" prop="i" style="width:100%">
                <el-input v-model="repairForm.i"></el-input>
              </el-form-item>
              <el-form-item label="状态" prop="j" style="width:100%">
                <el-select v-model="repairForm.j" filterable>
                  <el-option label="正常" value="1"></el-option>
                  <el-option label="维修" value="2"></el-option>
                </el-select>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="安装位置" prop="k" style="width:100%">
                <el-input v-model="repairForm.k"></el-input>
              </el-form-item>
              <el-form-item label="品牌" prop="l" style="width:100%">
                <el-input v-model="repairForm.l"></el-input>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="规格型号" prop="m" style="width:100%">
                <el-input v-model="repairForm.m"></el-input>
              </el-form-item>
              <el-form-item label="供应商" prop="n" style="width:100%">
                <el-input v-model="repairForm.n"></el-input>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="生产商" prop="o" style="width:100%">
                <el-input v-model="repairForm.o"></el-input>
              </el-form-item>
              <el-form-item label="使用年限(年)" prop="p" style="width:100%">
                <el-input v-model="repairForm.p" placeholder="数字"></el-input>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="保修期(年)" prop="q" style="width:100%">
                <el-input v-model="repairForm.q" placeholder="数字"></el-input>
              </el-form-item>
              <el-form-item label="购置日期" prop="r" style="width:100%">
                <el-date-picker v-model="repairForm.r" type="date" placeholder="格式：YYYY-MM-DD"></el-date-picker>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="安装日期" prop="s" style="width:100%">
                <el-date-picker v-model="repairForm.s" type="date" placeholder="格式：YYYY-MM-DD"></el-date-picker>
              </el-form-item>
              <el-form-item label="设备原值(元)" prop="t" style="width:100%">
                <el-input v-model="repairForm.t" placeholder="数字"></el-input>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="是否固资" prop="u" style="width:100%">
                <div class="row-1-border">
                  <el-radio v-model="repairForm.b" label="1" size="mini">是</el-radio>
                  <el-radio v-model="repairForm.b" label="2" size="mini">否</el-radio>
                </div>
              </el-form-item>
              <el-form-item label="IP地址" prop="v" style="width:100%">
                <el-input v-model="repairForm.v"></el-input>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="购资价(元)" prop="w" style="width:100%">
                <el-input v-model="repairForm.w" placeholder="数字"></el-input>
              </el-form-item>
              <el-form-item label="分摊价(元)" prop="x" style="width:100%">
                <el-input v-model="repairForm.x" placeholder="数字"></el-input>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="折旧率(%)" prop="y" style="width:100%">
                <el-input v-model="repairForm.y" placeholder="数字"></el-input>
              </el-form-item>
              <el-form-item label="主维保方" prop="z" style="width:100%">
                <el-input v-model="repairForm.z"></el-input>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="维保执行方" prop="aa" style="width:100%">
                <el-input v-model="repairForm.aa"></el-input>
              </el-form-item>
              <el-form-item label="维保执行方地址" prop="ab" style="width:100%">
                <el-input v-model="repairForm.ab"></el-input>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="维保执行方姓名" prop="ac" style="width:100%">
                <el-input v-model="repairForm.ac"></el-input>
              </el-form-item>
              <el-form-item label="维保执行方电话" prop="ad" style="width:100%">
                <el-input v-model="repairForm.ad"></el-input>
              </el-form-item>
            </div>
            <div class="row-1">
              <el-form-item label="维保起始日期" prop="ae" style="width:100%">
                <el-date-picker v-model="repairForm.ae" type="date" placeholder="格式：YYYY-MM-DD"></el-date-picker>
              </el-form-item>
              <el-form-item label="维保起始结束" prop="af" style="width:100%">
                <el-date-picker v-model="repairForm.af" type="date" placeholder="格式：YYYY-MM-DD"></el-date-picker>
              </el-form-item>
            </div>
            <div style="padding: 0 2vw 0 0">
              <el-form-item label="描述" prop="ag" style="width:100%">
                <el-input v-model="repairForm.ag" type="textarea" :rows="1"></el-input>
              </el-form-item>
              <el-form-item label="文件资料" prop="ah" style="width:100%">
                <el-upload class="upload-demo" action="https://jsonplaceholder.typicode.com/posts/" :on-preview="handlePreview" :on-remove="handleRemove" :before-remove="beforeRemove" multiple :limit="6" :on-exceed="handleExceed" :file-list="fileList">
                  <el-button size="small" type="primary">点击上传</el-button>
                  <span style="font-size:8px"> (最多上传6个文件)</span>
                </el-upload>
              </el-form-item>
              <el-form-item label="设备二维码"></el-form-item>
            </div>
          </el-form>
        </div>
        <template #footer>
          <span class="dialog-footer">
            <el-button type="primary" size="mini" @click="repairSure2Btn">确定</el-button>
            <el-button type="info" size="mini" @click="repairDialog2 = false">取消</el-button>
          </span>
        </template>
      </el-dialog>
    </div>

  </div>
</template>

<script>
import Header from "@/components/Header";
import moment from "moment";
import LInput from "../../../components/LInput.vue";
import LButton from "../../../components/LButton.vue";
import LDateTimeSelect2 from "@/components/LDateTimeSelect2.vue";
import LSelect from "@/components/LSelect.vue";
import CsvExportor from "csv-exportor"; //导出csv
import LInput2 from "@/components/LInput2.vue";

export default {
  components: {
    Header,
    LInput,
    LButton,
    LDateTimeSelect2,
    LSelect,
    LInput2,
  },
  data() {
    return {
      close: false,
      name: "",
      campus: "1",
      esys: "1",
      spec: "",
      position: "",
      state: "1",
      no: "",
      louyu: "1",
      cate: "1",
      guanli: "1",
      yunwei: "1",
      time: [],
      suoshu: "",
      dep: "",
      v1: "",
      v2: "",
      brand: "",
      supplier: "",

      option1: [
        { label: "全部", value: "1" },
        { label: "梁山县水泊商务中心", value: "2" },
      ],
      option2: [
        { label: "全部", value: "1" },
        { label: "设备系统", value: "2" },
      ],
      option3: [
        { label: "全部", value: "1" },
        { label: "正常", value: "2" },
        { label: "维护", value: "3" },
        { label: "报废", value: "4" },
      ],
      option4: [
        { label: "全部", value: "1" },
        { label: "主楼", value: "2" },
        { label: "餐厅楼", value: "3" },
      ],
      option5: [
        { label: "全部", value: "1" },
        { label: "冷水机组", value: "2" },
        { label: "循环水泵", value: "3" },
      ],
      option6: [
        { label: "全部", value: "1" },
        { label: "物业公司", value: "2" },
      ],
      option7: [
        { label: "全部", value: "1" },
        { label: "机关事务局", value: "2" },
      ],
      option8: [
        { label: "全部", value: "1" },
        { label: "工程部", value: "2" },
      ],
      option9: [
        { label: "全部", value: "1" },
        { label: "销售部", value: "2" },
      ],

      tableData1: [
        {
          a: "大机房1#冷机",
          b: "01",
          c: "",
          d: "梁山县水泊商务中心",
          e: "主楼",
          f: "公共设备",
          g: "冷水机组",
          h: "正常",
          i: "",
          j: "主楼地下室大制冷机房",
          k: "0",
          l: "麦克维尔",
          m: "",
          n: "0",
          o: "",
        },
      ],

      repairDialog: false,
      repairForm: {},
      repairDialog1: false,
      repairForm1: {},
      repairDialog2: false,
      repairForm2: {},
    };
  },
  mounted() {},
  beforeUnmount() {},
  methods: {
    //获取低价格
    getNewInput1(i) {
      this.v1 = i;
    },
    //获取高价格
    getNewInput2(i) {
      this.v2 = i;
    },
    //获取时间
    getNewTime(t) {
      this.time = t;
    },
    //下拉框获取院区
    getNewSelected1(s) {
      this.campus = s;
    },
    //下拉框获取设备系统
    getNewSelected2(s) {
      this.esys = s;
    },
    //下拉框获取设备状态
    getNewSelected3(s) {
      this.state = s;
    },
    //下拉框获取楼宇
    getNewSelected4(s) {
      this.louyu = s;
    },
    //下拉框获取设备分类
    getNewSelected5(s) {
      this.cate = s;
    },
    //下拉框获取管理人
    getNewSelected6(s) {
      this.guanli = s;
    },
    //下拉框获取运维单位
    getNewSelected7(s) {
      this.yunwei = s;
    },
    //下拉框获取运维单位
    getNewSelected8(s) {
      this.suoshu = s;
    },
    //重置条件
    clearSelected() {
      this.name = "";
      this.campus = "1";
      this.esys = "1";
      this.spec = "";
      this.position = "";
      this.state = "1";
      this.no = "";
      this.louyu = "1";
      this.cate = "1";
      this.guanli = "1";
      this.yunwei = "1";
      this.time = [];
      this.suoshu = "";
      this.dep = "";
      this.v1 = "";
      this.v2 = "";
      this.brand = "";
      this.supplier = "";
    },
    //导出
    exportExcel() {
      console.log("导出数据按钮点击~~~");
      let tableData = this.tableData1;
      let header = [
        "设备名称",
        "设备编码",
        "规格型号",
        "院区",
        "所属楼宇",
        "设备系统",
        "设备类别",
        "设备状态",
        "安装时间",
        "安装位置",
        "设备原值(元)",
        "品牌",
        "生产商",
        "保修年限",
        "出厂编码",
      ];
      CsvExportor.downloadCsv(tableData, { header }, "设备台账.xls");
      console.log("导出数据按钮点击结束~~~");
    },
    //清空"新增"弹窗内容
    repairDialogClose() {
      this.$refs.repairFormRef.resetFields();
    },
    //===============================================================
    //清空“查看”弹窗内容
    repairDialog1Close() {
      this.$refs.repairForm1Ref.resetFields();
    },
    //删除按钮
    del() {
      this.$confirm("此操作将永久删除该信息, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
        center: true,
      })
        .then(() => {
          // post("/airChannel/deleteAirChannel", { id: id }).then((res) => {
          //   // console.log(res);
          //   if (res.data.code == 200) {
          //     this.$message.success(res.data.data);
          //     this.getData();
          //   } else {
          //     this.$message.error(res.data.data);
          //   }
          // });
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消删除",
          });
        });
    },
    //查看履历按钮
    goto() {
      // this.$router.push("/template");

      //跳转打开一个新的页面
      let a = this.$router.resolve({ path: "/template" });
      window.open(a.href, "_blank");
    },
  },
};
</script>

<style lang="less" scoped>
@import "../opera.less";

.search_bar {
  width: 100%;
  height: 40px;
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.row-1 {
  display: flex;
  justify-content: space-between;
  padding: 0 2vw 0 0;

  .row-1-border {
    height: 31px;
    border: 1px solid #72aeff;
    border-radius: 5px;
    padding: 0 0 0 25px;
  }
}

/deep/ .el-dialog .el-select {
  width: 215px;
}

/deep/ .el-dialog .el-date-picker {
  width: 210px;
}
</style>
